home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 668 < prev    next >
Internet Message Format  |  1996-08-06  |  1KB

  1. Path: chaos.kulnet.kuleuven.ac.be!usenet
  2. From: christian.felique@student.kuleuven.ac.be (christian felique)
  3. Newsgroups: comp.std.c
  4. Subject: Close all opened files in C ?
  5. Date: 29 Mar 1996 11:44:42 GMT
  6. Organization: Katholieke Universiteit Leuven
  7. Message-ID: <4jgifa$fjd@chaos.kulnet.kuleuven.ac.be>
  8. NNTP-Posting-Host: cc399.cc.kuleuven.ac.be
  9. X-Newsreader: WinVN 0.92.6+
  10.  
  11. I am using a shareware C routine to play a sound sample
  12. throught the PC speaker. 
  13.  
  14. SoundPlay("SAMPLE.VOC",delay,twiddle);
  15.  
  16.  
  17. I think that the programmer
  18. of the routine has forgotten to take care of closing the sample file
  19. after it is played, because the routine will not work anymore after a few
  20. calls (about 10 calls) (It displays an Out of Memory message)
  21.  
  22. I think that the Out of Memory error has got nothing to
  23. do with the size of a sound sample file, because:
  24.  
  25. * You can call the routine for about 10 times using a small sample.
  26. *            " " " " " """"""""""""""10  """"""""""""large """""""
  27.  
  28. According to me, the reason for the out of memory error
  29. is the fact that there are too many file buffers open .
  30.  
  31.  
  32. NOW THIS IS MY QUESTION:
  33.  
  34. How can I close all files that are opened ?
  35.  
  36. I can't use fclose(...) because fclose needs a file pointer as
  37. an argument. 
  38.  
  39. If you know how to solve this problem in Quick C or
  40. inline assembly. Then send me your answer
  41. to:
  42.  
  43.  
  44.     CHRISTIAN.FELIQUE@STUDENT.KULEUVEN.AC.BE
  45.  
  46.  
  47.  
  48.